/**
 *  @file SortAlgorithm.h
 */
#ifndef _SORTALGORITHM_H_
#define _SORTALGORITHM_H_

#include "../../common/commontypes.h"
#include "../../util/FuncPtrT.h"
#include "../ICollection.h"

namespace cppflib
{

namespace collections
{

namespace sort
{

/**
 *   Comparison function during sorting
 *
 *   @return 0 -- both with the same value
 *   @return < 0 -- ele1 is "less" than ele2
 *   @return > 0 -- ele1 is "greater" than ele2
 */
typedef util::BaseFuncPtr2T<int, ptrany_t, ptrany_t> SortCmpFunc;

/**
 *  Heap sort
 */
_DLLAPI void HeapSort(ICollection &collection, const int startIndex, const int count, const SortCmpFunc &cmpFunc);


}  // end of namespace sort

}  // end of namespace collections

}  // end of namespace cppflib


#endif
